package com.lrkj.back.service.impl;

import java.util.List;
import java.util.Map;

import com.lrkj.back.mapper.ZsPackageImformationMapper;
import com.lrkj.back.entity.ZsPackageImformation;
import com.lrkj.back.service.ZsPackageImformationService;
import com.lrkj.back.vo.KucunNum;
import com.lrkj.back.vo.KucunWarnVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.com.cbons.mamisay.parent.db.api.DBInterface;
import cn.com.cbons.mamisay.parent.exception.DBException;
import cn.com.cbons.mamisay.parent.service.base.ParentServiceImpl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;

@Transactional
@Service("packageimformationService")
public class ZsPackageImformationServiceImpl extends ParentServiceImpl<ZsPackageImformation> implements
        ZsPackageImformationService {

    @Autowired
    private ZsPackageImformationMapper zsPackageInformationMapper;

    @Override
    protected DBInterface<ZsPackageImformation> getDao() throws DBException {
        return zsPackageInformationMapper;
    }

    @Override
    public PageInfo<ZsPackageImformation> findAllInformation(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsPackageImformation> tbList = zsPackageInformationMapper.findAllInformation(map);
        PageInfo<ZsPackageImformation> page = new PageInfo<>(tbList);
        return page;
    }

    @Override
    public int updateByBatch(List<ZsPackageImformation> list) throws DBException {
        return zsPackageInformationMapper.updateByBatch(list);
    }

    @Override
    public int insertBatch(List<ZsPackageImformation> list) throws DBException {
        return zsPackageInformationMapper.insertBatch(list);
    }

    @Override
    public int deleteBatch(List<String> list) throws DBException {
        return zsPackageInformationMapper.deleteBatch(list);
    }

    @Override
    public int deleteByPackageTiaomaArr(List<String> list) throws DBException {
        return zsPackageInformationMapper.deleteByPackageTiaomaArr(list);
    }

    @Override
    public List<ZsPackageImformation> findAll(Map<String, Object> map) throws DBException {
        return zsPackageInformationMapper.findAllInformation(map);
    }

    @Override
    public List<ZsPackageImformation> selectSin(Map<String, Object> map) throws DBException {
        return zsPackageInformationMapper.selectSin(map);
    }

    @Override
    public List<ZsPackageImformation> selectSinUp(Map<String, Object> map) throws DBException {
        return zsPackageInformationMapper.selectSinUp(map);
    }

    @Override
    public List<KucunNum> selectByGroup(Map<String, Object> map) throws DBException {
        return zsPackageInformationMapper.selectByGroup(map);
    }

    @Override
    public PageInfo<KucunNum> selectKeshibaoNum(Map<String, Object> map) throws DBException {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<KucunNum> tbList = zsPackageInformationMapper.selectByGroup(map);
        PageInfo<KucunNum> page = new PageInfo<KucunNum>(tbList);
        return page;
    }

    @Override
    public PageInfo<ZsPackageImformation> tongjiChaxunPage(Map<String, Object> map) {
        PageHelper.startPage(Integer.valueOf(map.get("pageNo").toString()),
                Integer.valueOf(map.get("pageSize").toString()));
        List<ZsPackageImformation> tbList = zsPackageInformationMapper.tongjiChaxun(map);
        PageInfo<ZsPackageImformation> page = new PageInfo<ZsPackageImformation>(tbList);
        return page;
    }

    @Override
    public List<ZsPackageImformation> tongjiChaxunTotal(Map<String, Object> map) {
        return zsPackageInformationMapper.tongjiChaxun(map);
    }

    @Override
    public List<KucunWarnVO> findRestbao(Map<String, Object> map) throws DBException {
        return zsPackageInformationMapper.findRestbao(map);
    }

    @Override
    public List<ZsPackageImformation> findMiejunLinChuang(Map<String,Object> map )throws DBException{
        return  zsPackageInformationMapper.findMiejunLinChuang(map);
    }
}
